import {createRouter, createWebHashHistory} from "vue-router";

const routes = [
    {
        path: '/',
        component: () => import('../components/AppMain'),
        children: [
            {
                path: '/',
                name: 'MainHome',
                component: () => import('../pages/MainHome'),
            },
            {
                path: '/user',
                name: 'UserHome',
                component: () => import('../pages/user/UserHome')
            },
            {
                path: '/other',
                name: 'OtherHome',
                children: [
                    {
                        path: '/page1',
                        name: 'Page1Home',
                        component: () => import('../pages/other/Page1Home')
                    },
                    {
                        path: '/page2',
                        name: 'Page2Home',
                        component: () => import('../pages/other/Page2Home')
                    }
                ]
            },
            {
                path: '/student',
                name: 'StudentHome',
                children: [
                    {
                        path: '/student/query',
                        name: 'StudentQuery',
                        component: () => import('../pages/student/StudentQuery')
                    },
                    {
                        path: '/student/edit',
                        name: 'StudentDivide',
                        component: () => import('../pages/student/StudentDivide')
                    },
                    {
                        path: '/student/import',
                        name: 'StudentImport',
                        component: () => import('../pages/student/StudentImport')
                    }
                ]
            },
            {
                path: '/system',
                name: 'SystemHome',
                children: [
                    {
                        path: '/system/college',
                        name: 'CollegeManagement',
                        component: () => import('../pages/system/CollegeManagement')
                    },
                    {
                        path: '/system/specialty',
                        name: 'SpecialtyManagement',
                        component: () => import('../pages/system/SpecialtyManagement')
                    },
                    {
                        path: '/system/user',
                        name: 'UserManagement',
                        component: () => import('../pages/system/UserManagement')
                    }
                ]
            }
        ]
    }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router